<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script charset="utf-8" src="/js/lib/jquery183.js"></script>
    <script charset="utf-8" src="/editor/kindeditor-min.js"></script>
    <script charset="utf-8" src="/editor/lang/zh_CN.js"></script>
    <script>
        KindEditor.ready(function(K) {
            window.editor = K.create('#editor_id',{
                uploadJson : '/upload',
                        fileManagerJson : '/upload',
                        allowFileManager : true
            });
        });
    </script>
    <script type="text/javascript">
        $(function(){
            $('[name=column]').change(function(){
                $('[name=columnname]').val($("[name=column] option:selected").attr('tue'));


            })
        })
    </script>
</head>
<body>
<div>
    <%if(d==0){%>

    <form action="/mycenter/changearticle" method="post" enctype="multipart/form-data">
         <input type="hidden" name="id" value="<%=list._id%>">
        <input type="hidden" name="columnid" value="<%=columnid%>">
        <input type="hidden" name="columnname" value="<%=columnname%>">
        <p>文章标题：<input type="text" name="title" value="<%=list.title%>"></p>
        <p>文章关键字：<input type="text" name="key" value="<%=list.key%>"></p>
        <p>文章说明：<textarea name="desc"><%=list.desc%></textarea></p>
        <p>文章添加时间：<input type="text" name="date" value="<%=list.date%>" ></p>
        <p>文章缩略图：<input type="file" name="img"  ></p>
        <p><img src="/upload/<%=list.img%>" width="200" height="200" /> </p>
        <input type="hidden" name="imgurl" value="<%=list.img%>">
        <p>文章浏览数：<input type="text" name="look" value="<%=list.look%>"></p>
        <p>文章简介：<textarea  name="profile" ><%=list.profile%>></textarea>*200字以内 </p>
        <p>所属栏目：<select name="column">

                <option tue="<%=list.columnname%>" value="<%=list.columnid%>" selected="selected">——<%=list.columnname%>——</option>
                <% columnlist.forEach(function(data){ %>
                <%if(data.length>1){%>
                <%for(var i=0;i<data.length;i++){%>
                <%if(i==0){%>
                <option tue="<%=data[i].name%>" value="<%=data[i]._id%>"><%=data[i].name%></option>
                <%}else{%>
                <option tue="<%=data[i].name%>" value="<%=data[i]._id%>">——<%=data[i].name%></option>
                <%}}%>
                <%}else{%>
                <option tue="<%=data.name%>"  value="<%=data._id%>"><%=data.name%></option>
                <%}%>
                <%})%>

            </select></p>
        <p>文章内容：<textarea id="editor_id" name="content" style="width:700px;height:400px;"><%=list.content%></textarea> </p>
        <p><input type="submit" value="提交"> </p>

    </form>

    <%}else{%>
    <p>恭喜你，更新文章成功！</p>
    <%}%>
</div>
</body>
</html>